<?php
/**
 *
 * @package    opensocial
 * @subpackage activity
 * @author     Daniel Botelho <botelho.daniel@gmail.com>
 */
class JSFunctionErrorCallback extends JSFunction
{
  function __construct(OSActivity $activity)
  {
     parent::__construct(
       /*$activity->getActivityVarName()."_callback"*/ null,
       $activity->getActivityVarName()."_data",
       "if(".$activity->getActivityVarName()."_data.hadError()) alert(".$activity->getActivityVarName()."_data.getErrorCode() + ': ' + ".$activity->getActivityVarName()."_data.getErrorMessage());"
     );
  }
}
